package com.zufe.test2;

public class GoodsTest {
    public static void main(String[] args) {
        Goods g1 = new Goods(1, "apple", 5.0, 100);
        Goods g2 = new Goods(2, "banana", 3.0, 200);
        Goods g3 = new Goods(3, "orange", 4.0, 150);

        Goods [] goods = new Goods[3];

        goods[0] = g1;
        goods[1] = g2;
        goods[2] = g3;
        for (int i = 0; i < goods.length; i++) {
            System.out.println("id: " + goods[i].getId() + ", name: " + goods[i].getName() + ", price: " + goods[i].getPrice() + ", num: " + goods[i].getNum());
        }
    }
}
